﻿namespace RuTrackerLib.Editors.Links.Editors
{
    class CurrentDirectoryEditor : ILinkEditor
    {
        private readonly string _directory;

        public CurrentDirectoryEditor(string directory)
        {
            _directory = directory;
        }

        public Link EditLink(Link link)
        {
            Link newLink = link.Clone();
            newLink.HRef = link.HRef.Remove(0, 2);

            GenericLinkEditor editor = new GenericLinkEditor(_directory);
            return editor.EditLink(newLink);
        }
    }
}
